<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<MvcEngineModelItem<IPagination<Log>>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title><%= Model.Localize("LogPageTitle")%></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="page-title" id="logs-header">
         <h1><%= Model.Localize("LogPageHeader")%></h1>
    </div>
    <div class="page-menu">
    <%= Html.PostActionLink(Model.Localize("ClearLink"), Url.ClearLogs(), Html.DeleteConfirmDialog(), false)%>
    </div>
    <%= Html.Grid(Model.Item).Columns(column =>
{
    column.For(x => Html.UrlActionLink(Html.Image(Url.ImagePath("view.gif"), Model.Localize("ViewAltText")), Url.LogDetails(x.Id), false) +
        Html.PostActionLink(Html.Image(Url.ImagePath("delete.gif"), Model.Localize("DeleteAltText")), Url.DeleteLog(x.Id), Html.DeleteConfirmDialog(), false))
     .Header(Model.Localize("ActionsLabel")).DoNotEncode();
    column.For(x => x.Message).Header(Model.Localize("TitleHeader"));
    column.For(x => x.Type).Header(Model.Localize("TypeHeader"));
    column.For(x => x.CreatedDate).DoNotSplit().Header(Model.Localize("CreatedDateHeader"));
}).Attributes(cellSpacing => "0", cellPadding => "0", border => "0")
  .RowAttributes(row => 
  { 
      var attr = new Dictionary<string, object>();
      if (row.IsAlternate)
          attr["class"] = "log";
      else
          attr["class"] = "log alt";
      return attr;
  })
  .Footers(footer =>
  {
      footer.For(Model.Localize("PagesLabel") + Model.Item.TotalPages.GetPaging(p => Html.UrlActionLink(p.ToString(), Url.Logs(p)) + "&nbsp;")).DoNotEncode().Attributes(colspan => "3");
      footer.For(string.Format(Model.Localize("TotalItems"), Model.Item.TotalItems));
  })%>
  
</asp:Content>
